/***********************************************
 * Title:       ExcelMapping.java
 * Description: ExcelMapping.java
 * Author:      NiDeveloper
 * Create Date: 2010-4-24
 * CopyRight:   CopyRight(c)@2009
 * Company:     TJUSCS
 * Version:     1.0
 ***********************************************
 */
package com.younker.waf.excelUpload;

import java.util.HashMap;
import java.util.Map;

import org.apache.log4j.Logger;

/**
 * @author NiDeveloper
 * 
 */
public class ExcelMapping
{
        private static Logger log = Logger.getLogger(ExcelMapping.class);

        private String name;
        private String resultClass;
        private String resultHandler;
        private Map<String, ColMapping> colMappings = new HashMap<String, ColMapping>();

        /**
         * @return the name
         */
        public String getName()
        {
                return name;
        }

        /**
         * @param name
         *                the name to set
         */
        public void setName(String name)
        {
                this.name = name;
        }

        /**
         * @return the resultClass
         */
        public String getResultClass()
        {
                return resultClass;
        }

        /**
         * @param resultClass
         *                the resultClass to set
         */
        public void setResultClass(String resultClass)
        {
                this.resultClass = resultClass;
        }

        /**
         * @return the resultHandler
         */
        public String getResultHandler()
        {
                return resultHandler;
        }

        /**
         * @param resultHandler
         *                the resultHandler to set
         */
        public void setResultHandler(String resultHandler)
        {
                this.resultHandler = resultHandler;
        }

        /**
         * @return the colMappings
         */
        public ColMapping getColMapping( String colName)
        {
                return colMappings.get(colName);
        }

        public void addColMapping(ColMapping colMapping)
        {
                colMappings.put(colMapping.getColName(), colMapping);
                log.debug("ExcelMapping[name=" + name + "] add colMapping:" + colMapping);
        }

        /*
         * (non-Javadoc)
         * 
         * @see java.lang.Object#toString()
         */
        @Override
        public String toString()
        {
                return "ExcelMapping [colMappings=" + colMappings + ", name=" + name
                                + ", resultClass=" + resultClass + ", resultHandler="
                                + resultHandler + "]";
        }

}
